package org.example;

import java.util.Scanner;

public class Test3 {
    //卡码网 57 爬楼梯 https://kamacoder.com/problempage.php?pid=1067
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(),m = sc.nextInt();
        int[] dp = new int[n + 1];
        dp[0] = 1;
        for (int i = 1; i <= n; i++) {
            for (int j = i-1; j >= 0 && j >= i-m; j--) {
                dp[i] += dp[j];
            }
        }
        System.out.println(dp[n]);
    }
}
